package com.uy.system.controller;

import com.uy.system.model.vo.SysDeptVO;
import com.uy.system.response.ResponseMessage;
import com.uy.system.response.ResponseMessageFactory;
import com.uy.system.service.ISysDeptService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author ly
 * @since 2024-03-22
 */
@Tag(name = "部门信息接口文档")
@RestController
@RequestMapping("/sysDept")
public class SysDeptController {

    @Resource
    private ISysDeptService iSysDeptService;

    @Operation(summary = "获取部门信息")
    @Parameters({
            @Parameter(name = "accessToken",description = "请求token",required = true,in = ParameterIn.HEADER)
    })
    @GetMapping("/getSysDeptTree")
    public ResponseMessage<List<SysDeptVO>> getSysDeptTree(){
        return ResponseMessageFactory.getSuccessResponseMessage(iSysDeptService.getSysDeptTree());
    }

}
